﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Net;

namespace NotificationTypes
{
    public class NotifyByEmail : INotificationType
    {
        private SmtpClient sc;
        public NotifyByEmail()
        {
            sc = new SmtpClient();
            sc.EnableSsl = true;
            sc.Credentials = new NetworkCredential("pkunha@gmail.com", "246700");
        }

        #region INotificationType Members

        public bool Send(MessageDetails md)
        {            
            sc.Send(md.sender, md.receptor, md.subject, md.msg);
            return true;
        }

        public bool SendSeveral(MessageDetails[] md)
        {            
            foreach (MessageDetails m in md)
                sc.Send(m.sender, m.receptor, m.subject, m.msg);
            return true;
        }

        #endregion
    }
}
